import 'uno.css'
import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";
import router from "./router";
// element-plus
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import mitt from "mitt";


// import {}
// Ant Design Vue
import Antd from "ant-design-vue";
import "ant-design-vue/dist/reset.css";
import './style.css'

import MetaInfo from 'vue-meta-info'

createApp(App).use(MetaInfo)
// 滑块
// import MakeitCaptcha from "makeit-captcha";
// import "makeit-captcha/dist/captcha.min.css";

// import './assets/main.css'

// icon
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import * as echarts from "echarts";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { createRouter, createWebHistory } from 'vue-router';
// import routes from './router';
// 创建router实例
//  router = createRouter({
//   history: createWebHistory(),
//   router,
// });
// 使用路由守卫来设置页面标题
router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
});
import piniaPersist from 'pinia-plugin-persistedstate'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import VueUeditorWrap from 'vue-ueditor-wrap';

const pinia = createPinia();
pinia.use(piniaPersist)

const app = createApp(App);


app.use(VueUeditorWrap)
app.config.globalProperties.$echarts = echarts;
app.config.globalProperties.$bus = mitt()
app.use(pinia);
app.use(router);
app.use(Antd);

app.use(ElementPlus, {
  locale: zhCn,
});

app.config.warnHandler = () => null;

// icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

window.document.dispatchEvent(new Event("render-event"));
app.mount("#app");
